package com.Test;

import com.demo.Hero;
import com.demo.SimpleFactory;
import com.demo.Weapon;

/**
 * Created by Administrator on 2018/9/19.
 */
public class Test {
    public static void main(String[] args) {
//        Weapon w = new Knife();
        Weapon w = SimpleFactory.getWeapon();
               Hero h = new Hero("龙哥", w);
//        Hero h=new Hero();
        h.setName("龙哥");
        h.fight();
    }
}
